﻿<phone:PhoneApplicationPage 
    x:Class="ActivityTracker.MyActivities"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:local="clr-namespace:ActivityTracker"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False" 
    Loaded="PhoneApplicationPage_Loaded">

    <Grid x:Name="LayoutRoot" Background="{StaticResource bipivot}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Foreground="White" Text="ACTIVITY TRACKER - MY ACTIVITIES" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,15">
            <ListBox x:Name="lbxActivities" SelectionChanged="lbxActivities_SelectionChanged" local:TiltEffect.IsTiltEnabled="True" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border Height="100" Width="450">
                            <StackPanel Height="90" Width="450" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,0,0,0">
                                <Image Width="50" Height="50" Source="{Binding ActImageSrc}"/>
                                <TextBlock  Foreground="White" Margin="10,0,0,0" Width="390" Text="{Binding ActName}" TextWrapping="Wrap" FontSize="36" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        <StackPanel Margin="0,0,0,0" Grid.Row="2">
            <my:AdControl  Margin="0,5,0,0" Height="80" HorizontalAlignment="Center" x:Name="adControl3" VerticalAlignment="Top" Width="480" ApplicationId="c8736437-6eec-403e-b9d4-333c4e6794d1" AdUnitId="28360" IsAutoRefreshEnabled="True" BorderBrush="Transparent"/>
        </StackPanel>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.new.rest.png" Text="new" Click="AppnBarNew_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.edit.rest.png" Text="edit" Click="AppBarEdit_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/PastActivity.png" Text="past activity" Click="AppBarAddPastActivity_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.cancel.rest.png" Text="delete" Click="AppBarDelete_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="schedule activity" Click="AppBarNewSchedule_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
